﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WMSSystem.YSL.Dto.LoginDto
{
    /// <summary>
    /// 获取用户列表输入参数
    /// </summary>
    public class GetUserListInput
    {
        /// <summary>
        /// 用户名（模糊查询）
        /// </summary>
        public string? UserName { get; set; }

        /// <summary>
        /// 真实姓名（模糊查询）
        /// </summary>
        public string ?RealName { get; set; }

        /// <summary>
        /// 手机号（模糊查询）
        /// </summary>
        public string ?PhoneNumber { get; set; }

        /// <summary>
        /// 邮箱（模糊查询）
        /// </summary>
        public string? Email { get; set; }

        /// <summary>
        /// 是否禁用（null表示查询所有）
        /// </summary>
        public bool? IsDisabled { get; set; }

        /// <summary>
        /// 创建时间开始
        /// </summary>
        public DateTime? CreationTimeStart { get; set; }

        /// <summary>
        /// 创建时间结束
        /// </summary>
        public DateTime? CreationTimeEnd { get; set; }
    }
    /// <summary>
    /// 用户列表输出DTO
    /// </summary>
    public class GetUserListOutput
    {
        /// <summary>
        /// 用户ID
        /// </summary>
        public Guid Id { get; set; }

        /// <summary>
        /// 用户名
        /// </summary>
        public string UserName { get; set; }

        /// <summary>
        /// 真实姓名
        /// </summary>
        public string RealName { get; set; }

        /// <summary>
        /// 手机号
        /// </summary>
        public string PhoneNumber { get; set; }

        /// <summary>
        /// 邮箱
        /// </summary>
        public string Email { get; set; }

        /// <summary>
        /// 是否禁用
        /// </summary>
        public bool IsDisabled { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreationTime { get; set; }
    }

    /// <summary>
    /// 分页用户列表输出DTO
    /// </summary>
    public class GetUserListPagedOutput
    {
        /// <summary>
        /// 用户列表
        /// </summary>
        public List<GetUserListOutput> Items { get; set; }

        /// <summary>
        /// 总记录数
        /// </summary>
        public long TotalCount { get; set; }

        /// <summary>
        /// 当前页码
        /// </summary>
        public int PageIndex { get; set; }

        /// <summary>
        /// 每页大小
        /// </summary>
        public int PageSize { get; set; }

        /// <summary>
        /// 总页数
        /// </summary>
        public int TotalPages => (int)Math.Ceiling((double)TotalCount / PageSize);
    }
}